package org.lgiavedoni.android.franq.util;

import java.util.Collection;
import java.util.Date;
import java.util.Random;

public class RandomUtil {

	private static Random generator = new Random();

	public static String getValue(String[] values) {
		return values[generator.nextInt(values.length)];
	}

	public static String getValue(Collection<String> values) {
		return (String) values.toArray()[generator.nextInt(values.size())];
	}

	public static Object getValue(Object[] values) {
		return values[generator.nextInt(values.length)];
	}

	public static Date generateRandomDate() {
		return new Date(System.currentTimeMillis() - ((long) (generator.nextDouble() * System.currentTimeMillis())));
	}

	public static boolean getBoolean() {
		return generator.nextBoolean();
	}

	public static double valueBetween(double min, double max) {
		return min + (generator.nextDouble() * (max - min));
	}

	public static void main(String a[]) {
		for (int i = 0; i < 10; i++)
			System.out.println(valueBetween(-100, 100));

	}

}
